<h3 xmlns="http://www.w3.org/1999/html">Lista distributera</h3>
<meta name="viewport" content="initial-scale=1">
<button class="btn btn-success" ng-click="izmeniDistributera('novi')" data-toggle="modal" href="#editModal">
    <i class="icon-calendar icon-white"></i>&nbsp;Kreiraj novog distributera</button>
	<div class="pull-right">	
		<label>Pronađi distributera: &nbsp;</label>
		<input ng-model="search.$" class="form-control">
	</div>
<table id="searchObjResults" class='table table-striped'>
    <thead>
    <tr>
        <th>Distributer</th>
        <th>&nbsp;</th>
        <th>&nbsp;</th>
    </tr>
    </thead>
    <tbody>
    <tr>
		<td>
			<label ng-click="orderByField = 'nazivDistributera'; reverseSort = !reverseSort">
				<b>Naziv</b>
				<span ng-show="orderByField == 'nazivDistributera'">
					<span ng-show="!reverseSort" class="glyphicon glyphicon-chevron-down"></span>
					<span ng-show="reverseSort" class="glyphicon glyphicon-chevron-up"></span>
				</span>
			</label>
		</td>
		<td></td><td></td>
    </tr>
    <tr ng-repeat='distributer in distributeri | filter:search:strict | orderBy:orderByField:reverseSort' onload="JavaScript:timedRefresh(500);">
        <td>{{distributer.nazivDistributera}}</td>
        <td><a ng-controller="PromeniDistributeraListCtrl" class='btn btn-warning' ng-click="izmena(distributer);" href="#/promeniDistributera">Izmeni</a></td>
        <td>
            <button ng-controller="DistributerListCtrl" class="btn btn-danger" ng-click="delete(distributer)">
                <span class="glyphicon glyphicon-trash"></span> &nbsp;Obriši
            </button>
        </td>
    </tr>
    </tbody>
</table>
<div class="modal fade"  tabindex="-1" role="dialog" ng-include="'view/distributer-detalji.html'" id="editModal" aria-hidden="true"></div>
</div>